import java.util.Scanner;
import java.util.*;

public class MC0330奇怪的数 {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        // code here
        int n = input.nextInt();
        int count = 0;
        for (int i = 1; i <= n; i++) {
            if (Count(i)) {
                count++;
            }
        }
        System.out.println(count);
        input.close();
    }

    public static boolean Count(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum == 10;
    }
}
